The present disclosure relates to image processing apparatuses, image processing methods, programs and electronic apparatuses, and in particular, to an image processing apparatus, an image processing method, a program and an electronic apparatus capable of performing tone compression which is able to prevent deterioration of image quality, with a simple configuration.
From the past, in electronic apparatuses provided with imaging function such as digital still cameras and digital video cameras, solid state image sensors which include, for example, CCD (Charge Coupled Device), CMOS (Complementary Metal Oxide Semiconductor) image sensor, or the like have been used.
An imaging apparatus in which such a solid state image sensor is employed has a narrower dynamic range than that of, for example, an imaging apparatus in which an optical film is employed. As a result, with the imaging apparatus in which the solid state image sensor had been employed, in cases where imaging was performed against backlight, “blown out highlights” (over-exposures), which is a loss of gradation in a bright part, and “crushed blacks” (under-exposures), which is a loss of gradation in a dark part, had easily occurred. In response to this, recently, it has become possible to obtain RAW image signals which have a luminance gradation at wide dynamic range comparable to that of photographs using optical films, with progresses in solid state image sensors (low noise) and technologies of synthesizing bracketed exposures.
Meanwhile, there is still a limit in the luminance gradation that can be rendered, with file formats for storing the imaged videos and still images (e.g., JPEG (Joint Photographic Experts Group), MPEG (Moving Picture Experts Group), etc.), commonly-used display devices such as CRT (Cathode Ray Tube) and LCD (Liquid Crystal Display) or printers. In other words, the dynamic range that can be rendered by using a display device may be narrow. Because of this, even if the RAW image signals having the luminance gradation at such a wide dynamic range comparable to that of photographs using optical films (hereinafter referred to as “wide dynamic range image”) were to be obtained, such a wide dynamic range might not be able to be stored or rendered (displayed, printed, etc.). It should be noted that the RAW image signals are output signals of a so-called “imager”.
Accordingly, there is a demand for a dynamic-range compression processing technology to perform compression of the luminance gradation of a wide dynamic range image to narrow the dynamic range, and to convert it to an image able to be rendered by existing apparatuses such as display devices (hereinafter referred to as “narrow dynamic range image”).
For example, Japanese Patent Application Laid-open No. Hei 9-331469 discloses a technology of adaptively determining a redistribution of gradation on the basis of a histogram of luminance of a wide dynamic range image. In this technology, by processing such as making a histogram from the gradation of the wide dynamic range image, the gradation is redistributed in accordance with a gradation of narrower dynamic range of the display device or the like, thereby generating a narrow dynamic range image. Further, by determining a gradation conversion curve such that the luminance values around the peak of the histogram can be distributed to as many gradation levels as possible, it avoids deterioration of contrast regarding an important subject imaged. As this technology, the techniques with which the output luminance is uniformly determined for the luminance of an input image are called “global tone compression methods”.
However, with the global tone compression method, regarding changes in luminance where differential values in the gradation conversion curve are small (luminance at which the range of gradation would be cut off), the changes in luminance would be small. This may result in a problem that the image would be visually unappealing; because its low-amplitude contrast feeling and solidity of the subject (these properties may be collectively-referred to as textures or details) would be lost.
In turn, there has been a tone compression method which might solve the problem with the visual quality in the global tone compression method; that is, a local tone compression method. This method uses the findings that a large dynamic range image may usually be generated by lighting with strong contrast rather than by the contrast of the subject itself. Accordingly, this method includes performing the tone compression only on the component of the lighting, so that the dynamic range would be narrowed.
Such methods are called “local tone compression methods” in contrast with the global tone compression methods, because the output luminance is not uniformly determined for the luminance of an input image in this method, and the relation between the input and output luminance may vary pixel by pixel.
For example, Japanese Patent Application Laid-open No. 2004-221644 discloses a technology of using a local tone compression method, by subjecting an image to tone compression using a global tone compression method and then compensating the image for components other than the component of the lighting. This technology uses the property of distribution of lighting usually being spatially smooth in areas other than edge parts. Thus, this technology includes band-separating the image at low pass filter, to treat the image components of the low-frequency side as the component of the lighting.